import Cookie from 'js-cookie'
export default {
    state: {
        project_name: 'tzc',
        token: '',
    },
    mutations: {
        // 设置token
        setToken (state, val) {
            state.token = val;
            Cookie.set('token', val, 60 * 60 * 12)
        },
        clearToken (state) {
            state.token = '';
            Cookie.remove('token')
        },
        getToken (state) {
            state.token = state.token || Cookie.get('token')
        },
        closeBrowser (state) {
            state.token = '';
        }
    }
}